package ru.mirent.schemegenerator;

import java.util.ArrayList;
import java.util.List;

public class Names {
    private List<Part> list = new ArrayList<>();

    public void addIfAbsent(Part part) {
        boolean found = false;
        for(Part p: list) {
            if (part.getClassName().equals(p.getClassName())) {
                found = true;
                break;
            }
        }

        if (!found) {
            list.add(part);
        }
    }

    public void show() {
        for (Part p: list) {
            System.out.println(p.getClassName());
        }
    }
}
